home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / ss303.zip / ss.txt < prev   
Text File  |  1994-05-06  |  8KB  |  180 lines

  1. *------------------------------------------------------------------*
  2. |    NAME:     SS (STRINGSEARCH)                                   |
  3. |    FUNCTION: Search for a String in Files                        |
  4. *------------------------------------------------------------------*
  5.  
  6. Provides  an  easy  method  of finding an ASCII or HEX string in any
  7. file in any directory.  The string may be either case  sensitive  or
  8. insensitive ASCII, or may be a HEX byte sequence.  The search may be
  9. global  or  limited in paths and filespec. Far more useful than FIND
  10. or LOCATE.  May be also used as a quick file finder  by  either  not
  11. specifying a string, or by using the /B option. Invoked by:
  12.  
  13.       SS /?             ;(shows command format and options)
  14.   or  SS [/options] ['string'] [[D:][path][filespec] ... ]
  15.   or  SS [/options] ["string"] [[D:][path][filespec] ... ]
  16.  
  17. e.g.   SS  /c/s C:\*.ASM '"string"' will search all ASM files on all
  18. directories on drive C for "string" in upper or lower case.
  19.  
  20. Note that multiple filespecs may be included on each command line.
  21. e.g.  SS /C/S '"string"' C:\X*.XYZ B: will search all directories on
  22. C: and from current directory on B: for "string" in the files X*.XYZ
  23. without case sensitivity.
  24.  
  25. <ESC>  will  quit  scanning  current  file  and  go  to next file in
  26. sequence. Any other key will pause/continue scanning and listing.
  27.  
  28. /7 - 7-bit comparisons
  29. This is the default mode.  It may be used in conjunction with the /H
  30. option   to  force  hexadecimal  byte  sequence  comparisons  to  be
  31. insensitive to the top bit.  If used, it must follow the /H option.
  32.  
  33. /8 - 8-bit comparisons
  34. Normally SS will strip the top bit of all bytes before  comparisons.
  35. The  /8 option preserves the full 8-bit comparison and shows graphic
  36. characters.  To test for 8-bit codes  use  the  <ALTnnn>  method  to
  37. define the codes within the string.
  38.  
  39. /B - Brief mode (no string display)
  40. If only a list of the files containing "string" are required, the /B
  41. option will inhibit the string information.
  42.  
  43. /C - Case ignored
  44. Normally  the  files  being searched will look only for an identical
  45. match to "string".  e.g. the sequence HowiE in a file will not match
  46. "Howie".  However, the /C switch option will allow either upper case
  47. or lower case to be matched.  If the /C switch option is  used,  the
  48. file display will be converted entirely to lower case.
  49.  
  50. /Fc - Filler character
  51. The "filler" character is currently set to 0FAH (the  small  centred
  52. dot).   It  can be altered to any other printable character with the
  53. option /Fc, where "c" is any printable character.  Alternatively, it
  54. can be permanently patched in SS.COM at location 0103H.
  55.  
  56. /H - Hex strings
  57. String  sequences  are  normally  in  7-bit  ASCII  format.   If   a
  58. hexadecimal  byte  sequence (i.e. non-ASCII) is required, use the /H
  59. option,  placing  the  HEX  codes  (0-9,A-F)   within   the   string
  60. delimiters.   (A-F may be upper or lower case).  This mode forces /8
  61. (8-bit) mode, but  can  be  disabled  by  following  with  /7.   For
  62. example,  to search for the sequence 4F,7F,3C,01 in all COM files in
  63. the current path and all its subdirectories, but not show the string
  64. results, use the command:
  65.  
  66.       SS/h/s/b *.com "4f7F3c01"
  67.  
  68. /Mn - Matches each file
  69. Normally every match will be flagged in every file.  The  /M  option
  70. will  limit  the  search  to  the first match in each file.  The /Mn
  71. option (where n=1..9) will show the first "n" instances  of  matches
  72. in each file.
  73.  
  74. /N - No unused paths displayed
  75. Normally,  screen  output contains repeated carriage returns without
  76. linefeeds as files are searched.  This results  in  overprinting  or
  77. excessive  file lengths with redirection.  To limit path displays to
  78. only those containing matched files, use the /N option.
  79.  
  80. /P - Pause each page
  81. This option will cause the output to be suspended at the end of each
  82. full screen.  Very useful on faster PCs.
  83.  
  84. /S - Subdirectory paths searched
  85. By  default,  SS  will only use the current (or defined) path on the
  86. specified drive.  All subdirectory  paths  below  the  path  can  be
  87. searched if the /S switch option is selected.
  88.  
  89. /Tn- Text mode display
  90. Selecting the /T switch option  will  display  the  matching  string
  91. (where  possible)  as  three  lines  of  text,  with the middle line
  92. containing  the  matching  string.   Selecting   /Tn  (n=0..9)  will
  93. select 0..9 lines of text each side (about) the matching string
  94.  
  95. /U - Unix file input
  96. For  text  mode  display,  the end-of-line character is <CR> and the
  97. new-line character <LF> is ignored.   The  /U  option  reverses  the
  98. order  of these comparisons and automatically selects /T option.  If
  99. a  /Tn  option   other   than  the  default (1 line) is required, it
  100. must be specified after the /U option.
  101.  
  102. /W - White space compression
  103. The /W switch option will cause all  TABs  to  be  replaced  with  a
  104. single  space,  and  all instances of two or more consecutive spaces
  105. (or TABS) to be treated as a single space.
  106.  
  107. /B:dd/mm/yy - newest date "Before"
  108. This option allows a newest date to be specified.  Any file of newer
  109. date  will not be searched.  Format for the date must be /B:dd/mm/yy
  110. and have a trailing space if other parameters follow.
  111. e.g. SS /B:31/12/92 *.asm
  112.  
  113. This option does not affect the status of the /B option.
  114.  
  115. /D:dd/mm/yy - oldest date "Dated"
  116. This option allows an oldest date to  be  specified.   Any  file  of
  117. earlier  date  will  not  be  searched.  Format for the date must be
  118. /D:dd/mm/yy and have a trailing space if  other  parameters  follow.
  119. e.g. SS /D:1/1/92 *.asm
  120.  
  121. When  combined with the /B:date option, this allows search of only a
  122. restricted date range.  e.g.  SS /B:31/12/92  /D:1/1/92  *.asm  will
  123. only search *.ASM files with date ranges in 1992.
  124.  
  125.  
  126. Pressing <ESC> will cause SS  to  skip  to  the  next  file  in  the
  127. directory  at  the  next  occurrence  of a match.  The output can be
  128. paused at any time by pressing any key.  A second keypress  restarts
  129. the  output.   This  action  also  resets the page counter if the /P
  130. option is in effect.
  131.  
  132. Hint:  to get single match outputs, touch the <SPACE> bar as soon as
  133. the program starts.  Then restart the output by  pressing  any  <Fn>
  134. key.    The   function  keys  generate  two  "keystrokes"  in  quick
  135. succession, resulting in an immediate stop at the next output.
  136.  
  137.  
  138.  
  139.  
  140.  
  141. On Exit from SS, the ERRORLEVEL will be set to:
  142.  
  143.       0 if No string matches found
  144.       1 if string matches found
  145.       2 if /? Help was requested
  146.       3 if an Error was detected in the command or program
  147.  
  148.  
  149.                  NOTES ON COMPARISONS AND DISPLAYS
  150.  
  151. When  the /C case insensitivity option is  selected,  the  file  and
  152. string  data  is  first scanned and any UPPER CASE characters (A..Z)
  153. are converted to LOWER CASE.
  154.  
  155. If  the  /8  option  is also selected, then the full 8-bit codes are
  156. retained, so case insensitivity will only occur with the strict A..Z
  157. characters (i.e. 41H to 5AH) and not their equivalents with the  top
  158. bit set (i.e. C1H to DAH).
  159.  
  160. For  display  purposes some characters are filtered out and replaced
  161. with the filler character.
  162.  
  163. If no string is specified, all files matching the filespec  will  be
  164. displayed as though the /B option were selected with a NUL string.
  165.  
  166. SS  now  automatically  detects  display lines count and changes the
  167. number of lines per paged display to suit.  Each display page  shows
  168. 1 line less than the lines per page.
  169.  
  170. The /H option forces /8 to give genuine binary searches.  At the end
  171. of the search, the match string is shown in HEX  format  within  the
  172. delimiter  used,  and  also  in a filtered ASCII equivalence between
  173. parenthesis.
  174.  
  175. The filespec now uses the ambiguous format "x*" conversion to "x*.*"
  176.  
  177. Author:         howard Harvey
  178. Date Released:  5/MAY/94
  179.  
  180.